package com.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

public class HibernateUtil {
	
	private HibernateUtil() {
	}
	
	public static SessionFactory buildFactory(){
		SessionFactory sf=null;
		Configuration cfg=new Configuration().configure();
//		System.out.println(cfg.getProperty("hibernate.connection.driver_class"));
		sf=cfg.buildSessionFactory();
		return sf;
	}	
	public static Session getSession(){
		return buildFactory().getCurrentSession();
	}
}
